Corrected the handling of the parentNode property

Also added tests for it