Fix crash when a error occurs in a globalstep callback