Fixed NullPointerException in UserDaoImpl and tests for it