Fixed HXP.next(), as it was using max() for the non-looping branch instead of min()
Merge pull request #311 from Anheurystics/dev

Fix HXP.next()