fixed minor bugs in scripts