Free-energy computation and first-order phase transitions