diff --git a/diaspora_auth_provider.py b/diaspora_auth_provider.py
index f8a75682eba5625a34c69404c82ba35e84fd45bc..217a8586381854468418da7015b8d11770a5a3c2 100644
--- a/diaspora_auth_provider.py
+++ b/diaspora_auth_provider.py
@@ -39,13 +39,13 @@ class DiasporaAuthProvider:
             user=self.config.db_username,
             password=self.config.db_password,
             host=self.config.db_host,
-            port=self.config.port
+            port=self.config.db_port
         )
 
     @defer.inlineCallbacks
     def check_password(self, user_id, password):
-        # user_id is localpart:hs_bare. we only need the localpart.
-        local_part = user_id.split(':', 1)[0]
+        # user_id is @localpart:hs_bare. we only need the localpart.
+        local_part = user_id.split(':', 1)[0][1:]
         logger.info("Checking if user {} exists.".format(local_part))
         with self.connection.cursor() as cursor:
             yield threads.deferToThread( # Don't think this is needed, but w/e