Fixed a bug in array handling. Correct offset is now used.