Fix unnecessary . if the sub domain is empty