Fixes an array indexing crash.