Handle casting for cppia