Fixed a few more script bugs