Further fixes to the scanner

Signed-off-by: Udayan Banerji <ubanerji@alumni.usc.edu>