Fixed uncontrolled format string warning

See http://cwe.mitre.org/data/definitions/134.html.

Additionally made minor formatting changes.