Make registered proc check more robust