Fixed bug to handle dbPort when no database is selected