fix infinite recursion on dictionary entries that start with themselves