Got rid of casts in scan methods.