Improved tests. Minor changes