Added new tests and fixes.