Fixed simple command, moved input/output code under child process