Fix source obtaining
Fix leak