Variable serialization + fixes