Check for errors before running