Fixed kqueue issues