Bugfix for creating scalar array objects in some cases