scan - fixes and improvements