fixes and improvements