Code cleanup
Fixed detection for newer repositories