Squashed commit of the following:

commit 1f58495619b3d8eae3df0a6f7e01d205cea14fc7
Author: Jared Jurkiewicz <jared.jurkiewicz@gmail.com>
Date:   Thu Jun 26 11:03:00 2014 -0400

    Fix issue with parentNode as null, fixes #18130