Minor code clean up and handle bad input in spell searching.