Add various error checks for missing parameters.