Various fixes for run as service.
Merge branch 'master' of https://github.com/Sleepyhead/OPMStatusMonitor.git