Fix runtime errors with match cases.