Add tests for issues #35 and #38