Fixed some bugs, added script running, some tests