more fixes and improvements