Mutation vector was being incorrectly calculated, leading to occaisional errors when the random number in samplefromPDF function was close to 1