Some more bug fixes and some namespace changes