Thanks - that worked a treat.

You're basically being lucky at the moment
I guessed something like this was going on as in my larger application it was segfaulting, now it works fine.