Fix startup crashes due to too small locals size.

Thanks @Voltasalt