Title code

Made the title code slightly less horrible. Fixed some minor typos.