Fixed issue with get pid. Reworked task killing code (again).