Fix a bug in result formatter