Made getEvents exception safe. Minor renaming of internals.