Fixed ranking bugs in libs