Fixed problem with generics