small refactoring and bug fixing
Merge pull request #74 from dukhlov/master

startub scripsts were fixed