Some subshell fixing and rearranging