FEAT: improved RAW mode support (many fixes and filled missing code parts).