Fixed a few launchd related bugs