Fix failing tests
Implement @mattr-'s suggestions