Tests: use explicit casts when shortening types