Fixed some events bugs