many small fixes/improvements