Fixed null ref exception bug that was caused by writing null index values