Remove explicit casts from tests