Fixes bugs in stop function. Relies on ps only and not on pgrep.