cost and redib bug fixes