Added README and fixed bugs.