Fixed errors.

* Fixed errors due to interface/name changes.
* Added support for throwing exception in main for debug.