Any idea why this takes the whole revision history, but only uses the first item in the history list? I couldn't work it out. A later fix if it need not.