Fixed scanner bugs