Improve type casting for JsonPointer methods