Bug fixes to accessing using array subscript