Fix two bugs so example works