Fix get_source and get_source_ext so that they can be called more than once