Lots of small gotchas fixed.