Database script update and small contex fix