fixed serialize/unserialize

- almost correct datatype fixes