Fix if errors array is empty