bunch of small fixes