Fixed a bug in getting random scales.