Clean things up. Note: this and previous commit has not been tested.