many unit tests and some bug fixes, version bump.