Converting some values from int to long

and some other stuff