Added a clone function (just serialize then deserialize); fixed bugs with deserializing null values and enums.