fixed logic error in evaluating simple expressions