loads of small fixes