Tests and wraparound bugfix for get_prefix and get_suffix.