Revert "bugfixes"

This reverts commit 549fe118721c4d179b40173efab6e9ae1c49b47a.