Fix namespace and duplicate class issues