more small fixes and improvements