Fix the issues with chunk saving. Spammy debugging included. Closes #294, #292, #286

Signed-off-by: Ross Allan <rallanpcl@gmail.com>