fixed a bunch of compile errors
Fixed incorrect namespace issues
Pulled changes from dev back into working branch