Fix problems with parameter validation