Added a few bug fixes to make sure that the service correctly starts/stops