Backported multiple suggestions in spellchecker from 3.x

This PR backports some improvements from the 3.x branch to 2.4.x. I needed to do this for compatibility issues that prevent me from using 3.x. Are you fine with accepting this patch and tagging it as 2.4.2?

Thank you very much,

Aldo.