Cast error to integer for comparisons. Closes #235