Fix logic around dumping to multiple files.
Python3 compatibility.
Release 0.3.3.