Bug fixes and improvements.