Fix indexing when creating chain from float[]