Major bug fixes.