Improve getNextGroupSymbol: Check if rank is from room or not

Improve getNextGroupSymbol: Check if rank is from room or not depending on the given parameters.