Fixes issue #70, adds support for domains