Fixed some bugs updated documentation.