Fix some bugs with the source resolving software.