Fix: Transactions: Fix oldDoc reference

The 'oldDoc' was at times not referring to
the correct document, which posed a problem
when it came time to revert to it.