Fixed uninitialized memory read warning.
Fix a bounds issue with scripts.
Fix an old and annoying crash.