Functions fixed again