Some minor(ish) bug fixes.