more fixes from @ldodds