Added generics support and warnings cleanup.