tests and fixes for domain and history purging