Tests for #50
Fixes #159