Cleanup to avoid unchecked cast on conversion.