small fixes and improvements