Bug fixes

potpourri of bug fixes.  commit messages tell the story.