Revert "bug fixes."

This reverts commit 7c5c2accaf0ca8606164097a3eb992863b3cdaa3.