Bug fixes on input validation and some other touch-ups