Add more tests. General fixes.