Several changes and improvements