Fix getProperties method and rename to serialize()