fixed error in how command exit codes are returned