Fixed bugs.
Updated documentation.