Fixed service immediately exiting when started from the commandline.