bug fixes and clearer code related to domain-name-in-filename feature