Added checks for required parameters.