Fix domain handling