Improve enforcement of readonly fields