A few small code fixes to get examples working