Bugfix for input validation