Tidied up how page titles are generated.