BUG: tests fixed. new tests to be added.