greater than and lower than value search, some bugfixes and cleanups

Signed-off-by: Stefan Helmert <stefan.helmert@t-online.de>