Fix rescaling bug