Fixed small logic error.