Fix a loggic bug.