Welcome to the forum, stefanw. Glad you could join us!
Your template looks correct. I have no idea why the titles wouldn't appear correctly. Could you post a specific example where the title isn't displaying correctly and what the HTML source looks like for the page? Perhaps that might give us a clue as to how we can help.