Add unit test for checking prefixes
Flip buggy if statement

Please ignore my half-baked late-night coding decisions.