Fix a couple of purging bugs