Fixes crash caused by uninitialised count array. Fixes #27