minors fixes and improvements