small fixes to the advanced scanner, mostly a porting of how it is on bay.