Modified to work with new libtoxdata