Added tests and corrected minor mistakes in README.