Fix the ArrayIndexOutOfBoundsException that occurs on second startup.