Added support for enum parameters. Added clamp function