Bugfixes for arrays