Fix for bug #47

As I wrote in the bug #47 discussion, I am submitting a fix that allows to amend generic types. This fix causes small API extension, but backward compatibility is fully preserved.