Fixing #800: Add possibility to disable array optimizations during serialization