bugfixes in setting array values