diff --git a/BerkeleyDB.cabal b/BerkeleyDB.cabal
--- a/BerkeleyDB.cabal
+++ b/BerkeleyDB.cabal
@@ -1,5 +1,5 @@
 name: BerkeleyDB
-version: 0.8.5
+version: 0.8.6
 license: BSD3
 license-file: LICENSE
 cabal-version: >= 1.4
@@ -30,7 +30,7 @@
              0.8.5: Add db_sync.
              0.7.2: Fix on db4.7
     .
-    Contributors: Michael Stone
+    Contributors: Michael Stone, Balázs Jávorszky
 
 category: Database
 build-type: Simple
diff --git a/Database/Berkeley/Db.hsc b/Database/Berkeley/Db.hsc
--- a/Database/Berkeley/Db.hsc
+++ b/Database/Berkeley/Db.hsc
@@ -123,8 +123,10 @@
     DB_LOCK_NOTGRANTED      |    -- ^ Lock unavailable.
     DB_LOG_BUFFER_FULL      |    -- ^ In-memory log buffer full.
     DB_NOSERVER             |    -- ^ Server panic return.
+#if DB_VERSION_MAJOR < 5
     DB_NOSERVER_HOME        |    -- ^ Bad home sent to server.
     DB_NOSERVER_ID          |    -- ^ Bad ID sent to server.
+#endif
     DB_NOTFOUND             |    -- ^ Key/data pair not found (EOF).
     DB_OLD_VERSION          |    -- ^ Out-of-date version.
     DB_PAGE_NOTFOUND        |    -- ^ Requested page not found.
@@ -160,8 +162,10 @@
 dbErrFromNum (#const DB_LOCK_NOTGRANTED) = DB_LOCK_NOTGRANTED
 dbErrFromNum (#const DB_LOG_BUFFER_FULL) = DB_LOG_BUFFER_FULL
 dbErrFromNum (#const DB_NOSERVER) = DB_NOSERVER
+#if DB_VERSION_MAJOR < 5
 dbErrFromNum (#const DB_NOSERVER_HOME) = DB_NOSERVER_HOME
 dbErrFromNum (#const DB_NOSERVER_ID) = DB_NOSERVER_ID
+#endif
 dbErrFromNum (#const DB_NOTFOUND) = DB_NOTFOUND
 dbErrFromNum (#const DB_OLD_VERSION) = DB_OLD_VERSION
 dbErrFromNum (#const DB_PAGE_NOTFOUND) = DB_PAGE_NOTFOUND
diff --git a/Database/Berkeley/db_helper.c b/Database/Berkeley/db_helper.c
--- a/Database/Berkeley/db_helper.c
+++ b/Database/Berkeley/db_helper.c
@@ -238,7 +238,7 @@
     UNWRAP_DB_TXN();
     dbtxnp[0] = NULL;
     dbtxnp[1] = NULL;
-    dbtxn->abort(dbtxn);
+    return dbtxn->abort(dbtxn);
 }
 
 int _dbtxn_commit(DB_TXN** dbtxnp, u_int32_t flags)
@@ -246,7 +246,7 @@
     UNWRAP_DB_TXN();
     dbtxnp[0] = NULL;
     dbtxnp[1] = NULL;
-    dbtxn->commit(dbtxn, flags);
+    return dbtxn->commit(dbtxn, flags);
 }
 
 void _dbtxn_delete(DB_TXN** dbtxnp)
