Update PR #224 with passing tests

Updates PR #224, with fixed tests.