Misc improvements

I went through the example and fixed things I stumbled on. Feel free to adapt/rebase/etc as required.