Documentation and examples update

Also fixed a minor bug deleting the pid file