Perform error check when parsing node.
Fix position of doc in successful callback.