Fix Issue #10

Fixes #10, and cleans up some unused variables in sprintf.