Rasterize example improvements

Better error detection for the rasterize example.