Fix bug when using negative scales