Class cast fixes
Generics