Catch exceptions liberally when looking for sources.

Fix #279.