Fixes for a couple of rare conditions