Fixed bidding and added a test for it.