TAMAYA-3: Fixed failing tests, fixed infinite loop.
Updated Design-documentation.