Modified scripts to return exit code