Some bug fixes about remaining budget