renamed block => chunk (Stuart's suggestion)
gcc compatibility fixes