Fixing getEvents so it always returns an array