Add missing undef guards in analyze