Fix some edge cases

cc @sh1mmer @Matt-Esch
What case is this catching, where there is an error but not an error code?