improved handling of readonly and autogenerated fields