Bug Fix: Avoid ArrayIndexOutOfBoundsException.