Fix a bug when there is only one solution