Cleanup code and remove invalid use of dictionnary update.