Fix bug in select that would prevent errors from being indicated.

-1 is nonzero and will thus cause the first if statement to be
evaluated instead of the error block after that.