Merged mk01's get_sources changes into the resume branch.

This is to merge in mk01's changes to get_sources. There were conflicts but I think I merged it correctly.