Few namespace ref fixes and some helper utilities