checking 'read_only' when restoring object

Also, added unit tests to describe the problem I run into