Fix namespace issues and table name derivation method