Fixed bugs with reflection and array indexing