Our aim is to provide insights into some basic facts of US government debt management by introducing simple financial frictions in a Ramsey model of fiscal policy. We find that the share of short bonds in total U.S. debt is large, persistent, and highly correlated with total debt. A well known literature argues that optimal debt management should behave very differently: long term debt provides fiscal insurance, hence short bonds should not be issued and the position on short debt is volatile and negatively correlated with total debt. We show that this result hinges on the assumption that governments buy back the entire stock of previously issued long bonds each year, which is very far from observed debt management. We document how the U.S. Treasury rarely has repurchased bonds before 10 years after issuance. When we impose in the model that the government does not buy back old bonds the puzzle disappears and the optimal bond portfolio matches the facts mentioned above. The reason is that issuing only long term debt under no buyback would lead to a lumpiness in debt service payments, short bonds help offset this by smoothing out interest payments and tax rates. The same reasoning helps explain why governments issue coupon-paying bonds. Solving dynamic stochastic models of optimal policy with a portfolio choice is computationally challenging. A separate contribution of this paper is to propose computational tools that enable this broad class of models to be solved. In particular we propose two significant extensions to the PEA class of computational methods which overcome problems due to the size of the model. These methods should be useful to many applications with portfolio problems and large state spaces.