More fixes on types, tests and benchmarks