Add automatic casting for boolean fields