scripts bugfixes