Fixed login bugs and empty order check