Fix c cursor when there are no events

This adds a test showing how to reproduce the issue and fixes the c cursor to support no events.

@mkobetic @benbjohnson