Check that source folders exist before using them.

Fixes and closes #178.