Fixed bug where missing ranks caused empty output