Fixes for service script and PID determination