Fix removing ranks
Remove unnecessary debug statements
Allow spaces in ranks