Added call to resetPendingEvents in getEvents

Issue #39.