Improved some of the parameter checking.