Studies of the safety of materials for metal-ion batteries