Improved controller input validation