Add more logic in the spelling test