Fixed a bug where reserved word readonly was used for a field name.. TODO add other reserved words to a list somewhere.