More tests; move exceptions; fix minor issues