[JBMAR-120] Fix ordering of certain operations when read/writeObject is empty