Issue #3404508 by mstrelan, smustgrave, quietone: Fix strict type errors in Functional tests: Add casts and fix types where needed