Coping with Defective Software in Medical Devices