getlantern/lantern#1762 Suggested improvements to original fix

@myleshorton Suggestions from my review of your changes