Organized scripts a bit. Also fixed some compile-time errors.