Updated thermostatting in md.c

Change-Id: Ibc162621e5bb7c63436b89071ca4c07824670db8