#178 done #179 done #180 done #171 tests and samples fixed