fixes issue #17 (obscure bug with generics)