Fix logic error (noticed by clang warning)