Fixing bugs in reactive pairs, adding unit tests.