Changed serialization to ObjectInput/OutputStream