a variety of small fixes