Revert "bugfixes"

This reverts commit 15101a878b72bab73c0d5debcd0b23552fd0c067.