fix typos
raise decent exceptions
add first tests