Fix bug in getindex type signature