Many small fixes