Apply fixes from Demigods.