Improved DB test and added login test