Merged mk01's get_sources changes into the resume branch.

This merges mk01's changes to get_sources into the resume branch.