Fix lint issues
Speed up test by breaking out of a for loop if match found
Merge pull request #1001 from mc10/tests

Slightly modify tests