Fixed some bugs for qualified/unqualified