Fix empty serializer bug

Regression test + fix for issue #1072