many small fixes and changes