Fixed logic error.