Patch of fixes for bugs and oversights