Updated docs, added test for invalid max_rank values.