Cache the resolved titles

Also some other minor improvements