Add namespace declarations, and fix typos