correct improper rank decoding