Fixed a bug in .dir() where it would return non-element nodes.