Updated the framework to include third party code.

Also fixed bugs.