Fix for #5579

Certainly this is too naive since it mutates the keyword hash.