[master] Tighten type check in domain

Fixes #15
Check that `domain[2]` is `str` because in some cases it's an `int` and `list`
operations don't work on `int`s.
@bwrsandman I think you should also remove the `and domain[2]` which is useless (and confusing) after the change below, as an empty string will not cause a problem. You may want to change it to `and len(domain) == 3` which will avoid an `IndexError` when confronted with a bad formed domain, and which maybe was the original intent, but I would not do this as this will most certainly crash a couple of calls further down in the stack.