Fixed wrong comparison in tests
Refactored to support explicit parameters