Ensure errors are cleared before re-trying statements