lot of small fixes