Re-merged commit 1b92b55fe351453bf0fa776a7e4554d41c69739e, relating to pull request #46.