global and scan fixes