Fix Deadlock from previous commits
Fix issue #17; Serialization support for writeObject and readObject