Converted https://github.com/timvideos/planet/commit/d17acb7f0585e3a577c0d2e393f85956123bd495