Bugfixes and tests.
README update.