      return $borrowersync->update({ 'hashed_pin', _encrypt_pin( $pin ) });
 
  }
-@@ -564,6 +662,23 @@ sub _format_soap_error {
+@@ -564,6 +680,23 @@ sub _format_soap_error {
 
  }
 

+        } elsif ( $sync->syncstatus eq 'delete' ) {
+            $response = $client->slett( $cardnumber );
         }
+
+        ($response, $ok) = _responseOK($sync, $response, $patron, $client);
+        last if $ok;
     }
-    if ( $sync->syncstatus eq 'delete' ) {
-        $response = $client->slett( $cardnumber );
-    }

-    # Update the sync data according to the results
-    if ( $response->{'status'} && $response->{'status'} == 1 ) {

+        # Make sure syncstatus is 'new'
+        $sync->update( { 'syncstatus' => 'new' } );
+        return ($response, 0);
     }
-    return $response;

+    if ($cause =~ /Mangler verdi for sist_endret/) {
+        # Set an arbritary value to missing laststync, it will be corrected on next iteration
+        my $now = `date +"%Y-%m-%dT%T"`;
+        chomp($now);
+        $sync->update( { 'lastsync' => $now } );
+        return ($response, 0);
+    }
+
+    if ($cause =~ /SIST_ENDRET/) {
+        # NL has different timestamp; returnin an error like this:
+        #  endre: Uoverensstemmelse med gjeldende data i basen:
