When ksflatten fails, return a failure code (#1162881).