Fix trivial logic error