fixed some bugs related to namespace changes