I appreciate all the comments etc.
But i don't have the time to fix these corrections. Its open source so feel free to change it and reuse it yourself.
Carsten Allefeld has made some modifications that fix the normalisation problem. Except in the case of the type 5 distribution.
The sizeOut error has also been fixed.