Various changes and improvements.
