Fixed some string format specifiers (long int vs int)
Fixed an out of bounds access