Fixed missing-headers bug in delete-domain and modified SQL statements to sort by username or domain name