Converted https://github.com/timvideos/planet/commit/421845f1cfdebd03f05d3293f2a9b5c26a193006