MRHOF objective function: fix some errors on rank computation