Revert "Cleanup and fixes"

This reverts commit 05ff9eab37a0fc2a8a3eee8031c902712a62cfb3.