Fix bug on scaling