Fixing all the weird, hard-to deal with shell command invocations.  Also, random bug fixes.