diff --git a/pom.xml b/pom.xml
index c0237ee..4876e67 100644
--- a/pom.xml
+++ b/pom.xml
@@ -149,7 +149,7 @@
                         <exclude>**/*APITest.java</exclude>
                     </excludes>
                     <includes>
-                        <include>de.ids_mannheim.korap.**/*.java</include>
+                        <include>de/ids_mannheim/korap/**/*.java</include>
                     </includes>
                 </configuration>
             </plugin>
diff --git a/src/main/java/de/ids_mannheim/korap/handlers/EntityDao.java b/src/main/java/de/ids_mannheim/korap/handlers/EntityDao.java
index c5bf551..497b23c 100644
--- a/src/main/java/de/ids_mannheim/korap/handlers/EntityDao.java
+++ b/src/main/java/de/ids_mannheim/korap/handlers/EntityDao.java
@@ -53,7 +53,6 @@
             user = this.jdbcTemplate.queryForObject(sql, namedParameters,
                     new RowMapperFactory.UserMapper());
         }catch (EmptyResultDataAccessException ae) {
-            ae.printStackTrace();
             jlog.error("No user found for name '{}'", username);
             throw new EmptyResultException(username);
         }catch (DataAccessException e) {
diff --git a/src/main/java/de/ids_mannheim/korap/security/auth/KustvaktAuthenticationManager.java b/src/main/java/de/ids_mannheim/korap/security/auth/KustvaktAuthenticationManager.java
index 70b190b..680f67d 100644
--- a/src/main/java/de/ids_mannheim/korap/security/auth/KustvaktAuthenticationManager.java
+++ b/src/main/java/de/ids_mannheim/korap/security/auth/KustvaktAuthenticationManager.java
@@ -502,6 +502,7 @@
             UserdataFactory.getDaoInstance(UserDetails.class).store(details);
             UserdataFactory.getDaoInstance(UserSettings.class).store(settings);
         }catch (KustvaktException e) {
+            e.printStackTrace();
             throw new WrappedException(e, StatusCodes.CREATE_ACCOUNT_FAILED,
                     user.toString());
         }
diff --git a/src/test/java/de/ids_mannheim/korap/config/TestHelper.java b/src/test/java/de/ids_mannheim/korap/config/TestHelper.java
index 2a685a8..cc180f3 100644
--- a/src/test/java/de/ids_mannheim/korap/config/TestHelper.java
+++ b/src/test/java/de/ids_mannheim/korap/config/TestHelper.java
@@ -47,6 +47,7 @@
                         .createUserAccount(m, false);
             }catch (KustvaktException e) {
                 // do nothing
+                e.printStackTrace();
                 Assert.assertNull("Test user could not be set up", true);
                 return false;
             }
@@ -54,17 +55,17 @@
         return r;
     }
 
-    public static boolean setupSimpleAccount() {
+    public static boolean setupSimpleAccount(String username, String password) {
         boolean r = BeanConfiguration.hasContext();
         if (r && BeanConfiguration.getBeans().getUserDBHandler().size() == 0) {
             EntityHandlerIface dao = BeanConfiguration.getBeans()
                     .getUserDBHandler();
             Map m = new HashMap<>();
-            m.put(Attributes.USERNAME, credentials[0]);
+            m.put(Attributes.USERNAME, username);
 
             try {
                 String hash = BeanConfiguration.getBeans().getEncryption()
-                        .produceSecureHash(credentials[1]);
+                        .produceSecureHash(password);
                 m.put(Attributes.PASSWORD, hash);
             }catch (NoSuchAlgorithmException | UnsupportedEncodingException | KustvaktException e) {
 
@@ -96,19 +97,25 @@
         throw new RuntimeException("User could not be retrieved!");
     }
 
-    public static boolean dropUser() {
-        boolean r = BeanConfiguration.hasContext();
-        if (r) {
-            EntityHandlerIface dao = BeanConfiguration.getBeans()
-                    .getUserDBHandler();
-            try {
-                User us = dao.getAccount(credentials[0]);
-                dao.deleteAccount(us.getId());
-            }catch (KustvaktException e) {
-                // do nothing
-            }
+    public static boolean dropUser(String... usernames) {
+        if (usernames == null || usernames.length == 0)
+            usernames = new String[] { credentials[0] };
+        if (BeanConfiguration.hasContext()) {
+            for (String name : usernames)
+                remove(name);
         }
-        return r;
+        return BeanConfiguration.hasContext();
+    }
+
+    private static void remove(String username) {
+        EntityHandlerIface dao = BeanConfiguration.getBeans()
+                .getUserDBHandler();
+        try {
+            User us = dao.getAccount(username);
+            dao.deleteAccount(us.getId());
+        }catch (KustvaktException e) {
+            // do nothing
+        }
     }
 
     public static void drop() {
