Better character handling and dupe detection for keywords