Fixed crash when trying to pump messages closing after failure