Fixes bug #14 with a ratio scaling.