updated run_command() to return an error code; updated all tests that use run_command()