Fix array indexing with float values