Return a correct list of available namespaces.

This ensures that inner namespaces take precedence over outer namespaces.

Fixes #40.