Fix namespace pollution

It is discouraged to pollute the global namespace from header files (i.e. don't put `using ...` in headers). This change also catches some omissions and typos.