bugfixes and progress on run scripts