Add tests for issues #16 and #32