Bart,
I have reconciled the files and can see clearly where the missing code is and what it is. However to test a solution I need to restore an earlier version of the site that I am working on and right at the moment that is awkward.
So I can either summarise and post an 'this ought to do it' fix or leave it until I have fully tested a fix.