Updated version of pull request #1070

Why isn't this pulled yet?