Instead of using matrix.raw_data, use get_data() to retrieve data in proper size, with holes. This is not causing an error because the result of raw_data skips from 3700 to 3733 but the indexing is incorrect.
Should run a test after making this change to ensure results are as expected. Also consider replace raw_data with get_data() in SkimsAndPaths