misc regression fixes from squashed commit