Fixes a compilation failure and a couple of failing test cases

Fixes #3
Partial fix for #2