Fixed support for nested types

Nested types were not working. This is now fixed. E.g.

class foo
{
        enum bar { ... };
}