Fixed some issues with scaling