improving sitename detection+
Search and replace had caused many issues in test-cases. All fixed.