Fix issue where providing an empty prefix would cause prefix_len-1 to underflow, and result in a program crash