some bugfixes and advances toward raw file reading