More fixes for update/upgrade functions.
CODE_HISTORY and EDIT_HISTORY updated. Clarifying comments added.