I somehow missed wrapping all this stuff in 'using' statements.