Add tests for issues #117 and #118.