Fixed some errors with user-defined script :/