Fixes regression in enhance() extension from optimization.