Well, what happens when I change some code is that really weird behaviour occurs.
Like I've said I really think it's a memory related problem on your side which overwrites parts in the memory that belongs to other vars/pointers/etc. Would be a shame if the final version doesn't work :S