Input validation for Misc functions.