Various changes and improvements