Domain effects near the order-disorder and order-order ferromagnetic transitions in Gd and Dy