Removed some cursor derefing and fixed updating caret for an empty node