Add more checks to detect certain process call errors and exit