Fixed issue #377
Now we hold the db_alias value to enable the dereferencing when the
alias isn't default.