Fixed string matching, had bugs before