Fix a subshell issue and a couple errors in logic/syntax