Buxfix in comparison algorithm

Fixing a bug in case a not-minimal node is found (thanks Julien Josserand for pointing it out and proposing a correction).