Fix an issue that was inflating the output size massively (1.7 GB instead of 18 MB). FYI @npetters @ncalace