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