Repair broken test. Add new tests to prevent regression