Revert "Various fixes"

This reverts commit b227e85c72071b8e2c56475819a0a29448d1bf2c.
Various Fixes attempt 2