fix segfault when lower-case ranks are entered