Fix rank detection in parser.js