d[0] was set to 0.... wat? hmm.