Fixed debt calculation bug