Fix scaling bug