Moved default namespace init code into constructor to avoid threading issues.
Added null or whitespace namespace checks back in.