Misc fixes. Working now for several weeks.