Revert "Fixes #348" (Worked in wrong branch)

This reverts commit a0142806eb8dfad311b0f04726d07320760791f6.
Revert "Fixes #351" (Worked in wrong branch)

This reverts commit 69e0b9b6ad80407589a12de9fe53b8932e7e3dee.