Improve namespace handling.