Fix crashes in array access under certain circumstances.
arraytest.py works now.