Fix up rapid7/metasploit-framework#2656

Just retargeting #9 to the right branch.