Fixed bug in %d format