Effects of surface cooling on the spreading of lava flows and domes