Adjusted scripts so they always return a correct exit code and print output in a log format.