I realised that when I got back to my computer. Turns out another routine was altering the tagsize variable making it 2^32 + 2 :S Anyway fixed that and my code works fine now.

Still no joy with the debugger, but now I definately know it was the debugger. I might try a few different ones to see if I can find a better one.

Thanks for your help