Fixed some unit conversions and fixed a crash that would happen when switching modes.