Fix generics inheritance bug