Added protection for out-of-bounds #rank calls

Referencing issue #227. Added some very rudimentary protection for out-of-bounds #rank calls, so that the user can't accidentally call a rank that doesn't exist. Before, there was no error, and it would just give you the largest rank.