Clean up of printf to use sprintf and return the error via the Baton