A bunch of miscellaneous fixes

Warnings could interesting, especially to track down the 'close' after 'finish' issue.