Wrapped assertions in transactions and fixed faulty replacement of refnode