Fix generics bug in AbstractUnit