Revert "bugfixes"

This reverts commit f62c5bb96a3d5c9c3e0cec997cc74389ed32e7c9.