fixes set default rank and adds spec test for it