Updated namespace handling and class inheritance