How did extended-family communities deal with dangerous floods or enemies?