Added some petbattle functions and fixes