Refactored the fix for #2043: nil/false namespace
Merge pull request #2047 from gregbell/namespace-false-and-nil

Refactored the fix for #2043: nil/false namespace