Addressed 2 issues related to $digest cycle issues and trying to read undefined values.