Move duplacate unittests for D1 and fix issues