Fixed formula bugs and typos.