Merged in changes to chunk.cpp from 9.4 branch