Added function to check for caret-position nodes