Fixed error when changing scale