Fixed bug with scale factor