Readding more code that had disappeared due to a bad merge.