Fixed accessing the pointer in function
Fix namespace issues (where did this come from?)