Fixed tests and improvements to documentation.