Fix to correctly count semi-aligned reads in debug mode