Dechunk result if necessary

Fixes #2710. Implementation is based on OP @marcuslinke 's workaround.