Bugfixes.  Increased test coverage.