Nicer write_only fields implementation. Closes #1355