Update functionality. Some fixes to scripts