Added unit checking.