Detect and set SHELL when running a command. Fixes #265.