Fix copy/paste issues in compareSources.

Refactoring in 6a4638a introduced a small bug in compareSources;
if the second source was removed, then a SIGSEGV could be triggered.