d224 : integrated Artifice's pull request #142, several bug fixes