Add some parameter checking to track down error.