Not obvious how to reproduce but exporting to matlab once threw exception that `filepath` cannot be a tuple (in the line using `.endswith`)