Closes #39 by correcting the type bound update
Closes #97 with a test case

The issue was fixed in 367bb56d1bfc70a9b61da57bd6f29cc59d14611d.