Solves #152 by returning false when the ancestor is null

Please merge this one that fixes this firefox bug that my customers experienced recently
Thanks!