Non-trivial scripts fixed and slightly changed