minor fixes and improvements.