units: error checking