Fixed problems with the element factory spotted by @filedescriptor
Fixed problems with broken return values