fix a few script-breaking bugs