Added validation to parameters.