Make compatible with PW 2.4.5 per @adrianbj suggestions in ProcessWire issue #520