Updated create/update routine
Updated create/update routine and fixes with the scripts.