Minor fixes

A couple of minor stability tweaks.