Fixed bugs in scale