Effect of residual stresses and surface roughness on coercive force in amorphous alloys