Applied fixes to stored procs and refresh deployment scripts.