Tests for #35
Fix #35 with some small test fixes