Fix integer printing in writer