Small restructuring; trapped bad parameter values... I think.