Minor fixes, more tests