Fix scan and list commands.

Need to use pkg/1 and nonvar/1 to make sure that scan and list keep working
in the face of dynamic suffix packages.