updated new tests and fixed core to match spec changes.