Fix for timelapse assertion

*****
Dom, can you give this PR a once over? I cannot see how no-one has reported this issue, but I think this fix is actually needed to make timelapse work at all! Am I being dumb somewhere?
*****

Fixed a problem with some strings not being free'd inside a loop where they were being used.

No idea how this issue has arisen or why it has not been
reported, perhaps a recent git merge fault?