Reapplied pull request #106. Commit 1f3f3d6d8012 removed it.