Upgraded libraries. Removed several bugs.