Fixing bug in prefixes implementation