Fix for kwim-pm #5.

Not sure this catches everything, but hopefully most.