Add some more exception safety