* chunk reading helpers
* fixed C compilation