Fixes a range-check exception in the UnitsAPI code (VS2012)