Fixed boolean cast
Fixed elementPath usage