Made some generics-related changes, so it would compile using javac and
not only using Eclipse compiler