Please add unit tests for this in tests/unit.