Make compatible with version 2 of ptp.js