Fixed error decoding files

Not fully tested, needs additional check to assure the data extracted is correct, but now does not fails to open planets, stations, ships, catalog and factions (not tested with asteroids and other files)