Removed a comment.
Small simplification of enumeration of selected nodes.
Converted calls to $apply to $digest because $apply isn't really needed.