Fix error condition in #2992