Anomalous free energy changes induced by topology