Misc. fixes sitting around locally.

warning fix in a template and some -D_GLIBCXX_DEBUG fixes.