Cast boolean values to 0/1 in hidden fields