Finally fix #1379
Merge pull request #1389 from sjinks/issue-1379

Fix #1379 completely