Critical fixes and improvements.