Improved input field handling (Closes #130)