add some tests and fixes found by them \o/
lets hire travis.