Your vector normalization needs to check if the length of the vectors is zero. If it is it must return 0,0,0 instead of NaN.

NaN will bugger up all the following equations