Fixed shell-exec.c and some cleanups