Fixed background process handling and process terminating and ctr-C support