fixed incorrect reset of baton->error