Added unit testing for bad parameters.