Script unification and minor improvements