Ah, problem fixed, silly coding mistake.
I've now added my code to the sandbox: http://channel9.msdn.com/ShowPost.aspx?PostID=100392