Reduced example2 issue to a type cast