bug fixes for chunking of data. addresses issue #179