Calculate some geometry, fix typos.