Major bug fixies.