Lots of misc. bug fixes and notes.