better tests, bugs fixed.