Ok I've written an alternative version of the fix that I've been busytesting all evening.I think it's much better and it's about to be posted as a series of 3patches.Thanks.