Re-commit r257064, this time with a fixed assert