Study: Doctors' personal problems can lead to medical errors