Changed prefix checking to suffix checking.