Fix parser to reject invalid units