Distributed Fault-Tolerant Detection in Wireless Sensor Networks: Event and Faulty Sensor Detection