Fixes namespaces and minor errors in compile.