Fixed serialization issue with last refactor