Tests and fixes. In progress...