Fix for restart and PID issues.