Bash plugin unit tests + related minor fixes.