Serializer: fixed some bugs