Revert "Bug fixes and performance improvements"

This reverts commit 58b359041a29418876f12d37a7082ece9f8a38a4.
5 files changed