Updated Script Engine and some general changes