Add test for CastReader and fix cast-example