Added signal handlers and autokiller for CLI version. Fixes for in GUI.