Changed some println statements to printf (and corresponding format specifiers).