Fixing chunked object writer and adding unit test