Fix failing tests

Fixing a bug that Hassan introduced that is nearly impossible to recreate except for automated tests