fixes and behavior improvements to domain handling