Fixes issue #3776.
Edit @laanwj: clarified pull title
ACK if you make the commit message clearer too.
Automatic sanity-testing: FAILED MERGE, see http://jenkins.bluematt.me/pull-tester/1759e899c1630005fdf4dc5945433c6d80202d20 for test log.
This pull does not merge cleanly onto current master This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/ Contact BlueMatt on freenode if something looks broken.
I'm having some git issues, I think it's best if I start over with a separate pull request. Apologies for the noobishness.