Various bugfixes to make StorageArray working