Fix some NPE situations and ignore cancelled events