Fix build and kill event task on Ctrl-Q