Add explict casting to CDouble to avoid problems with implicit casting on different architectures (32bit vs 64bit)
Refactor addCharacters method