Revert "Nasty hack to fix issues"

This reverts commit 4803d6e83dfdf2c1c6dca0251930621d26c96af3.