Fixed issues with uppercase and only takes substring of last n
characters where n is the length of the pattern.