Improved validator, added checks for invalid values passed for custom class parameters