Fixed looping logic in SWORD server DefaultController.php.