Fixed handling of LogObject and MainObject in EventHandler.pm.