Check for null flags, changed iterator to angular iterator