fixed bugs in setOperations and in the ranking function

Signed-off-by: AK2083 <ankh.egypt.public@googlemail.com>