Fixed some bugs and replaced pkill