Many fix and improvements