Array reference warning fixes