Fixed additional bug in the collection of patients by rank.  Also added option to collect locations randomly instead of ordered.