Tweaks to work with ghc-mod; sh bug fixes.