fixed bugs in run_moses