*Fixed logic to process subshells.

*Fixed formatting.