more tests and fixes to builder