fixed bugs in the oracle layer.