Enable scaling.

Enables scaling, and fixes a bug.