Added test to check if a domain referenced from a variable exists, closes #3