Fixed more issues related to events