Fix for #5579

Certainly this is too naive since it mutates the keyword hash, but it illustrates the problem.