Improved AS inspection code