Fix serialization issue

Fixes BXC 5667 - SerializationException: The object with ID 1 could
not be resolved
Merge pull request #889 from slluis/serializer-fix

Fix serialization issue