Everything is working smoothly again. Execution speed increased by 10x. Cleaned up the code and unused stuff.