Enhance to allow intra-file duplicate checks and some minor const-correctness fix to keep compiler happy.
Merge pull request #5 from sonofusion82/intrafile_duplicates

Enhancement for intra-file duplicates and some minor const fixes.