bug fixes, refactoring bash_driver