fixes to deletion of contacts and principles