Tidying up the code a bit for merging multiple chunks. #281