Removed debug code
Fixed problems with reading wstrings on 64 bits systems
Fixed issue with reading/writing on *nix systems