Fixed an error check bug in some examples.