Fixed some syntax and namespacing errors