Cast IDs to known class to eliminate "multiple methods named count…" warnings