more bugfixes for chunking of data, ref issue #179