properly handle scopeloc, declloc, and calls