Fix bound in nearest plane algorithms

Signed-off-by: Nicolai Hähnle <haehnle@or.uni-bonn.de>