Detection or prevention of malfunction, including accident prevention