first part of tests and fixes