Fixed incorrect use of generics