This is the main bug this addresses, the other stuff came up while doing more thorough testing.