If you're actually using pins 14 and 15 you need to fix this too:
const int DIGITAL_PINS[D_PINS] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,16,17,18,19,20,21};
and D_PINS = 22
And if you're really using 0 - n pins in order you could just skip the DIGITAL_PINS array and put the number in directly...