Fixed segfault when adding to a 0 capacity array