Fixed several declaration errors and typos.