[WIP, do not merge yet] Fixing tests

Trying to fix test errors and failing tests before move forward
Starting point `Tests: 1125, Assertions: 3319, Failures: 89, Errors: 225, Incomplete: 12, Skipped: 336.`
I guess that if can be folded into the previous if