many minor changes and fixes