Fix incorrectly handled error in a corner case. Fixes #2