remote local variable access was always using variable with index 1 instead of the index specified by the access request (Fixes #1739)