fixed issues with reading RAW file format