Updated for HAPI 5.x and JOI 4.x