Fixed bug causing crashes in case max # open events wasn't set