Bugfixes in form serialization