Code cleanup and bug fixing

* Fix an error in getting FunctionGroup from base class if base class
doesn't contain any function defintion.
* Code cleanup for FunctionTable