Fixed remove bug in event queue (sync with  commit 59887c6 on bitbucket)