Improved namespace component check