fixed endian bug that appeared when reading global files