Fixed bug with scaling.