fix compile errors, cleanup namespaces