Fixed a few provenance-related bugs