Last scan should restore scanner source

Also make this more readable