Many small fixes/improvements