Code fixes and improvements.