Fixed some tests, added ldm initialization