Fix closing of pipes
Change which commands are run
Add special command handling