Fixes for handling domains better