Fixed, and added (mostly untested) support for virtual methods