Added code to write out the stddev of TP. Also some fiddling with captions etc in generated tables.