Fix a bunch of bugs where a transaction would be closed prematurely and/or repeatedly.
Fix a few RFC URLs.