Fixed wrong memory read when trying to read multiple files