Comparison of array size was using != on Integer object rather than
equals.