Fix some issues with qualified pointers.
Added check for redecl. of vars with no linkage.
Reworked some tests for local decls.