[misc] many minor fixes and changes