wrong sum with conditional function



Hello!

[using Maxima 5.19.0.]

Please have a look at this:

(%i1) d(k) := if k=0 then 0 else 1;
(%o1)                   d(k) := if k = 0 then 0 else 1
(%i2) assume(a>0);
(%o2)                               [a > 0]
(%i3) sum(d(k), k, 0, a);
(%o3)                                a + 1
(%i4) 

How comes this +1 in the result?

Best Regards

Alexandros