These fixes are great. I've also made them in the logging changes so we're likely to get a conflict when I merge that very shortly.