Fixed script problems