Improved hidden field handling