Fix duplicate/conflict checking
Add profiling