Changed scope during serialization. Fixes #13