Improved word detection