Fix example's compile and crash errors