diff --git includes/VersioncontrolAccount.php includes/VersioncontrolAccount.php
index 273ee56..52ac25a 100644
--- includes/VersioncontrolAccount.php
+++ includes/VersioncontrolAccount.php
@@ -89,7 +89,7 @@ abstract class VersioncontrolAccount extends VersioncontrolEntity {
     if ($username_changed) {
       $this->vcs_username = $vcs_username;
       db_query("UPDATE {versioncontrol_accounts}
-                SET username = '%s'
+                SET vcs_username = '%s'
                 WHERE uid = %d AND repo_id = %d",
                 $this->vcs_username, $this->uid, $repo_id
       );
@@ -139,7 +139,7 @@ abstract class VersioncontrolAccount extends VersioncontrolEntity {
    */
   public final function insert($additional_data = array()) {
     db_query(
-      "INSERT INTO {versioncontrol_accounts} (uid, repo_id, username)
+      "INSERT INTO {versioncontrol_accounts} (uid, repo_id, vcs_username)
        VALUES (%d, %d, '%s')", $this->uid, $this->repository->repo_id, $this->vcs_username
     );
 
diff --git includes/VersioncontrolRepository.php includes/VersioncontrolRepository.php
index 99bc542..f3f491a 100644
--- includes/VersioncontrolRepository.php
+++ includes/VersioncontrolRepository.php
@@ -478,7 +478,7 @@ abstract class VersioncontrolRepository implements VersioncontrolEntityInterface
   public function getAccountUidForUsername($username, $include_unauthorized = FALSE) {
     $result = db_query("SELECT uid, repo_id
       FROM {versioncontrol_accounts}
-      WHERE username = '%s' AND repo_id = %d",
+      WHERE vcs_username = '%s' AND repo_id = %d",
       $username, $this->repo_id);
 
     while ($account = db_fetch_object($result)) {
