Fixed floating point as array index bug