Add casting for fields