Revert "Minor bugfixes"

This reverts commit 4f8d939d7ec39498a6958a45b5808a0def08a97b.