Fix path generation during sample preprocessing