various bug fixes to get chunks working