Fix a bug in computing result