combine drained beans, salt and cayenne in a deep buttered 3 quart baking dish. Reserve 1 cup of grated cheesed for topping, then stir remaining cheese into bean mixture with chiles, green onion and corn. whisk the eggs. add milk and stir into bean mixture. top with tomatoes slices and cover. bake at 350 for 45 minutes. sprinkle with reserved cheese and return to oven until cheese melts.