fixes and fixes and tests