Added control for division by 0 in budget calculation