Address #387: prevent NPE when adding markup to <title> elements