Fixes and a Junit test.

Signed-off-by: Atheriel <atheriel@gmail.com>
Merge pull request #2 from atheriel/typechanges

Type fixes and a Junit test for them.