Fixed errors in history and viewcart