fixed warnings related to generics

changes with Jacob Aae Mikkelsen