Make de/serialization a little bit more sane