Fixed word counting issue causing messed up case conversion