Performance improvements for chunk handling.
This should give a nice performance boost with various chunk operations.