Fixed problems with scripts