Porting enmasse-related checks over from master.