fix PPTO, PPTI, elementCount errors, some other minor problems