Fix build after adding support for different databases.

Also adds missing "!" where we were rejecting correct passwords by accident.