script fixes
Fixed race condition closes #1715
Merge branch 'devel'