minor fixes and improvements