Modified so that all teh configuration code gets run at the appropriate
time.