Fix #1467
Test case for #1467
Fix #1466
Merge pull request #1468 from sjinks/issue-1467

Fix #1467
Merge pull request #1469 from sjinks/issue-1466

Fix #1466